import CommonApi from './common'

// 桥隧涵构造物--隧道
class BTCTunnelApi extends CommonApi {
    constructor() {
        super()
        this.scope = '/property/tunnel'
    }

    resolvePath(path) {
        return this.scope + path
    }
    // 获取隧道分页列表
    getTunnelList(data) {
        const path = this.resolvePath('/list')
        return this.post(path, data)
    }
    // 删除隧道
    tunnelDelete(data) {
        const path = this.resolvePath('/delete')
        return this.post(path, data)
    }
    // 隧道详情
    tunnelDetail(data) {
        const path = this.resolvePath('/detail')
        return this.post(path, data)
    }
    // 隧道名称唯一性检查
    tunnelNameCheck(data) {
        const path = this.resolvePath('/nameCheck')
        return this.post(path, data)
    }
    // 隧道编码唯一性检查
    tunnelCodeCheck(data) {
        const path = this.resolvePath('/codeCheck')
        return this.post(path, data)
    }
    // 新增、修改隧道 
    async saveOrUpdateTunnel(data) {
        const path = this.resolvePath('/saveOrUpdate')
        return this.post(path, data)
    }
    // 根据所属高速、方向获取线路
    getCodeNameList(data) {
        const path = '/property/vectorline/getCodeNameList'
        return this.post(path, data)
    }
}

export default BTCTunnelApi
